#pragma once
#include "instrument.h"
#include "AR.h"
#include "Subtractive.h"

class CSubtractiveInstrument :
	public CInstrument
{
public:
	CSubtractiveInstrument(void);
	~CSubtractiveInstrument(void);

	virtual void Start();
    virtual bool Generate();
    virtual void SetNote(CNote *note);
    
    void SetDuration(double d) {m_ar.SetDuration(d); m_sines.SetDuration(d);}
    void SetFreq(double f) {m_sines.SetFreq(f);}
	void SetPitch(double p) {m_sines.SetPitch(p);}
	void SetType(std::wstring t){m_sines.SetType(t);}
	void SetWavetable(std::vector<double> w){m_sines.SetWavetable(w);}
	void SetFrequency(double f) {m_sines.SetFrequency(f);}
	void SetBandwidth(double b) {m_sines.SetBandwidth(b);}
	void SetTime(double t) {m_sines.SetTime(m_time);}


private:
    CAR         m_ar;
    double  m_time;
	CSubtractive   m_sines;
	double m_frequency;
};

